package com.vne.skyemart.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.vne.skyemart.dao.PaymentDao;
import com.vne.skyemart.model.Payment;
import com.vne.skyemart.service.PaymentService;

@Service("paymentService")
@Transactional(propagation = Propagation.SUPPORTS,readOnly = true)
public class PaymentServiceImpl implements PaymentService{
	@Autowired
	private PaymentDao paymentDao;

	public PaymentDao getPaymentDao() {
		return paymentDao;
	}

	public void setPaymentDao(PaymentDao paymentDao) {
		this.paymentDao = paymentDao;
	}
	public PaymentServiceImpl() {}
	@Transactional(propagation = Propagation.SUPPORTS,readOnly = false)
	@Override
	public void addPayment(Payment payment) {
		paymentDao.save(payment);
	}

	@Override
	public List<Payment> listPayment() {
		return paymentDao.findAll();
	}
	
}
